<template>
  <div class="findView">
    <div class="title container">热卖中</div>
    <div class="container grid-container">
      <grid :gird-show-num="girdShowNum" class="grid" :aspect-ratio="'0.65'">
      </grid>
    </div>
  </div>
</template>
  
<script>
import grid from "@/components/Grid.vue";
import zfooter from "@/components/ZFooter.vue";
export default {
  name: "",
  components: { grid, zfooter },
  data() {
    return {
      clientWidth: document.body.clientWidth,
      girdShowNum: 4,
      gridImgObj: "fill",
    };
  },
  mounted() {
    window.onresize = () => {
      return (() => {
        this.clientWidth = document.body.clientWidth;
      })();
    };
    if (this.clientWidth > 768) {
      this.girdShowNum = 4;
    } else if (this.clientWidth <= 768) {
      this.girdShowNum = 2;
    }
  },
  watch: {
    clientWidth(Val) {
      if (Val > 768) {
        this.girdShowNum = 4;
      } else if (Val <= 768) {
        this.girdShowNum = 2;
      }
    },
  },
  created() {
  },
};
</script>
<style  lang="less" >
* {
  margin: 0%;
  padding: 0%;
}

.findView {
  margin-top: 70px;
  width: 100%;
  min-height: 70vh;
  display: flex;
  align-items: center;
  // justify-content: center;
  flex-direction: column;

  .title {
    margin-top: 20px;
    font-size: 28px;
    font-weight: 700;
    width: 100%;
    min-width: 1000px;
    max-width: 1200px;
    text-align: left;
    padding-left: 3rem;
  }

  .grid-container {
    position: relative;
    width: 100%;
    // min-width: 1000px;
    max-width: 1200px;
    // height: 500px;
    // overflow: scroll;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 50px;
    padding: 0 2rem;

    .grid {
      position: relative;

      .grid-item {
        position: relative;

        width: 90%;
        height: 95%;
        // background: #2465;
        box-sizing: border-box;
        overflow: hidden;
        background: #fff;
        box-shadow: 4px 4px 6px rgb(143, 140, 140);
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        @apply rounded-lg;

        .grid-img-box {
          position: absolute;
          width: 100%;
          height: 100%;
          overflow: hidden;

          .grid-img {
            position: relative;
            height: 100%;
            width: 100%;
            overflow: hidden;

            .el-image__inner {
              // height: auto !important;
            }
          }

          .popup {
            position: absolute;
            top: 0%;
            left: 0%;
            right: 0;
            bottom: 0%;
            margin: auto;
            // width: 200px;
            height: 40px;
            background: rgba(22, 21, 21, 0.757);
            color: #fff;
            border: 2px solid #fff;
            border-radius: 20px;
            line-height: 40px;
            z-index: 2;
            display: none;
          }
        }

        .grid-text {
          position: relative;
          height: auto;
          width: 100%;
          // top: 80%;
          background: white;
          // padding-bottom: 1rem;
          display: flex;
          flex-direction: column;

          .name {
            position: relative;
            width: 100%;

            h1 {
              text-align: left;
              padding: 0.5rem;
              padding-bottom: 0%;
              font-size: 1.2rem;
              // box-sizing: border-box;
              // color: rgb(16, 209, 209);
              font-weight: 600;
              text-indent: 0.5rem;
            }
          }

          .price-box {
            position: relative;
            width: 100%;
            height: auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.3rem 1rem;

            box-sizing: border-box;

            img {
              height: 100%;
              width: 35px;
            }

            .price {
              position: relaative;
              right: 0%;
              width: 80px;
              height: 100%;
              background: black;
              color: white;
              display: flex;
              align-items: center;
              justify-content: center;
              opacity: 0.3;
              cursor: pointer;
              @apply rounded-lg;
              padding: 0.2rem 0.5rem;
            }

            .price:hover {
              opacity: 0.8;
            }
          }
        }
      }
    }
  }

  .findmore-container {
    width: 100%;
    height: 50px;

    .find-button {
      width: 200px;
      height: 40px;
      border: 2px solid black;
      border-radius: 20px;
      background: transparent;
      color: black;
      cursor: pointer;
      transform: 0.5;
    }

    .find-button:hover {
      border: #fff;
      background: rgba(0, 0, 0, 0.6);
      color: #fff;
    }
  }
  .footer {
    width: 100%;
  }
}
</style>
  
<style lang="less">
.grid {
  .grid-img-box:hover {
    .popup {
      display: block !important;
    }

    .el-image__inner {
      transition: 0.6s;
      filter: blur(20px);
      -webkit-filter: blur(20px);
    }
  }
}
</style>